package com.imon.groovybox

def builder = new NodeBuilder()
def ulcDate = new Date(107,1,1)
def invoices = builder.invoices {
	
	invoice(date: ulcDate) {
		item(count: 5) {
			product(name: 'ULC', dollar: 499)
		}
		item(count: 1) {
			product(name: 'Visual Editor', dollar: 999)
		}
	}
	
	invoice(date: new Date(108,2,2)) {
		item(count: 4) {
			product(name: 'Visual Editor', dollar: 999)
		}
	}
	
}

println invoices.grep {
	 it.item.product.any { it.'@count'  <= 3 }
}.item.'@count'

